package com.willie.boot.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.willie.boot.dao.DeptDao;
import com.willie.boot.vo.Dept;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * ----------------------------------------------
 * <p>类    名：</p>
 * <p>版    权：copyright© firegy.willie</p>
 * <p>作    者: liang</p>
 * <p>创建时间: 2018/8/29 15:12</p>
 * <p>描    述: </p>
 * <p>修 改 人：</p>
 * <p>修改时间：</p>
 * -----------------------------------------------
 */
@Service
public class DeptService extends ServiceImpl<DeptDao, Dept> {
    @Resource
    private DeptDao deptDao;

    public List<Dept> findAll() {
        return this.list(new QueryWrapper<>());
    }

    /**
     * 查询部门根据部门编码
     *
     * @param deptno 部门编码
     * @return 部门
     */
    public Dept findDeptByDeptno(Long deptno) {
        return deptDao.findById(deptno);
    }
}
